//
//  KTMarketHomeCell.swift
//  KOLToken
//
//  Created by yangsan on 2020/2/27.
//  Copyright © 2020 iOS-team. All rights reserved.
//

import UIKit
import DynamicColor
import SwiftyFitsize
class KTMarketListBaseCell: UITableViewCell {
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        contentView.addSubview(coinName)
        coinName.snp.makeConstraints { (make) in
            make.top.equalToSuperview()
            make.width.equalTo(KTAppFrame.kScreenWidth / 3)
            make.left.height.equalTo(28~)
        }
        
        contentView.addSubview(exchangeName)
        exchangeName.snp.makeConstraints { (make) in
            make.left.height.width.equalTo(coinName)
            make.bottom.equalToSuperview()
        }
        
        contentView.addSubview(RMBPrice)
        RMBPrice.snp.makeConstraints { (make) in
            make.left.equalTo(coinName.snp_right)
            make.width.top.height.equalTo(coinName)
        }
        
        contentView.addSubview(dollarPrice)
        dollarPrice.snp.makeConstraints { (make) in
            make.left.equalTo(RMBPrice)
            make.width.top.height.equalTo(exchangeName)
        }
        
        contentView.addSubview(zdf)
        zdf.snp.makeConstraints { (make) in
            make.right.equalTo(-24~)
            make.width.equalTo(88~)
            make.height.equalTo(36~)
            make.centerY.equalToSuperview()
        }
        
        self.selectionStyle = .none
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    lazy var coinName: UILabel = {
        let label = FastLabel().fastCreateLabel(text: "ETH", color: nil, alignment: .left, textColor: DynamicColor.init(hex: 0x000000), font: UIFont.init(name: "PingFangSC-Regular", size: 16)!)
        return label
    }()
    
    lazy var exchangeName: UILabel = {
        let label = FastLabel().fastCreateLabel(text: "火币网", color: nil, alignment: .left, textColor: DynamicColor.init(hex: 0x212121), font: UIFont.init(name: "PingFangSC-Medium", size: 14)!)
        return label
    }()
    
    lazy var RMBPrice: UILabel = {
        let label = FastLabel().fastCreateLabel(text: "¥88.88", color: nil, alignment: nil, textColor: DynamicColor.init(hex: 0x212121), font: UIFont.init(name: "PingFangSC-Medium", size: 16)!)
        return label
    }()
    
    lazy var dollarPrice: UILabel = {
        let label = FastLabel().fastCreateLabel(text: "$8.88", color: nil, alignment: nil, textColor: DynamicColor.init(hex: 0x212121), font: UIFont.init(name: "PingFangSC-Medium", size: 14)!)
        return label
    }()
    
    lazy var zdf: UILabel = {
        let label = FastLabel().fastCreateLabel(text: "+20.34%", color: DynamicColor.init(hex: 0x0DB14B), alignment: nil, textColor: .white, font: UIFont.init(name: "PingFangSC-Medium", size: 14)!)
        label.layer.cornerRadius = 2
        label.layer.masksToBounds = true
        
        return label
    }()
}
